<!DOCTYPE html>
<html lang="en">

<head>
  <meta charset="UTF-8">
  <meta name="viewport" content="width=device-width, initial-scale=1.0">
  <title>Document</title>
  <style>
    /* 样式初始化 */
    ul,
    li {
      border: solid;
      margin: 0;
      padding: 0;
      list-style: none;
    }

    .menus {
      display: flex;
    }

    .menus>li {
      height: 30px;
      width: 100px;
      line-height: 30px;
      text-align: center;
      position: relative;
    }

    .menus>li:hover {
      background-color: bisque;
    }

    /* 二级菜单 */
    .submenus {
      position: absolute;
      left: 0;
      right: 0;
      top: 30px;
      display: none;
    }

    /* .menus>li>.submenus { */
    .menus>li:hover>.submenus {
      display: block;
    }

    .submenus>li:hover {
      background-color: azure;
    }
  </style>
</head>

<body>
  <ul class="menus">
    <li><a href="">用户</a>
      <ul class="submenus">
        <li><a href="">添加用户</a></li>
        <li><a href="">编辑用户</a></li>
        <li><a href="">删除用户</a></li>
      </ul>
    </li>
    <li><a href="">商品</a>
      <ul class="submenus">
        <li><a href="">添加</a></li>
        <li><a href="">编辑</a></li>
        <li><a href="">删除</a></li>
      </ul>
    </li>
    <li><a href="">配置</a></li>
  </ul>

</body>

</html>